<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <script src="https://cdn.bootcss.com/echarts/4.2.1-rc1/echarts.min.js"></script>
    <script src="https://code.jquery.com/jquery-2.1.4.min.js"></script>
    <title></title>
</head>
<body>
<div id="main" style="width: 1200px;height:300px;"></div>
<div>
    <a>频率值:</a>{% for fre in allfrequency %}
    <a>  {{fre.do}}    </a>
    {% endfor %}
</div>
</body>
<script type="text/javascript">
    var pressArr = {{pressArr}}
    ;//压力数组
    var myChart = echarts.init(document.getElementById('main'));
    var id = [];//横坐标数组
    for (var i = 1; i <= pressArr.length; i++) {
        id.push(i);
    }
    // 指定图表的配置项和数据
    var option = {
        xAxis: {
            type: 'category',
            data: id,
        },
        yAxis: {
            type: 'value',
        },
        series: [{
            data: pressArr,
            type: 'line',
            smooth: true
        }]
    };
    // 使用刚指定的配置项和数据显示图表。
    myChart.setOption(option);
</script>

</html>
